
<?php
$userId=$_GET["userId"];
$gameListName=$_GET["gameListName"];

/*$userId=$_POST["hiddenUserId"];
$gameListName=$_POST["gmListName"];*/

$con = mysql_connect("localhost","root","16991789");
if (!$con)
  {
  die('Could not connect: ' . mysql_error());
}

mysql_select_db("gamerlast", $con);


$sql="INSERT INTO gamelist (userId, gameListName) VALUES ('$userId','$gameListName')";

if (!mysql_query($sql,$con))
  {
  //die('Error: ' . mysql_error());
  	echo 0;
  }else{
	  	$sql="select max(gameListId) from gamelist";
		$result = mysql_query($sql,$con);
		$row = mysql_fetch_array($result);
		if ($row["max(gameListId)"]>0)//eger oyun game tablosunda varsa
			echo 1;
	  	else
			echo 0;
  }

mysql_close($con);
?>
